<%@page import="entities.User"%>
<%@page import="entities.SiteConfig"%>
<%@page import="java.util.TreeMap"%>
<%@page import="helpers.UrlHelper"%>
<%@page import="java.util.ArrayList"%>
<%
	TreeMap check = (TreeMap) request.getAttribute("check");
	String success = (String) request.getAttribute("success");
	User user = (User) request.getAttribute("user");
	SiteConfig siteConfig = (SiteConfig) request.getAttribute("config");
	String image = "";//UrlHelper.getServerUrl(request) + "/blobstore-serve?blob-key=" + siteConfig.getLogo();
%>


<jsp:include page="/demo/layouts/header.jsp">
    <jsp:param name="title" value="<%=siteConfig.getTitle()%>" />
    <jsp:param name="description" value="<%=siteConfig.getMetaDescription()%>" />
    <jsp:param name="keywords" value="<%=siteConfig.getMetaKeywords()%>" />
    <jsp:param name="ogsite_name" value="<%=siteConfig.getSiteName()%>" />
    <jsp:param name="ogtitle" value="<%=siteConfig.getTitle()%>" />
    <jsp:param name="ogurl" value="<%=UrlHelper.getServerUrl(request)%>" />
    <jsp:param name="ogimage" value="<%=image %>" />
    <jsp:param name="ogdescription" value="<%=siteConfig.getMetaDescription()%>" />
</jsp:include>

		<div class="dir">
			<a href="/home">Home</a> > Login
		</div>
		<br />
		<div class="submit-form">
			<form action="" method="post">
			<jsp:include page="/demo/elements/message.jsp" />
			<table width="100%" cellpadding="0" cellspacing="0">
				<thead>
					<tr>
						<td colspan="2"><div class="title-form">Login</div></td>
					</tr>
				</thead>
				<tbody>
					<tr>
						<td width="30%" class="username">Username</td>
						<td>
							<input type="text" name="username" value="<%=user.getUsername()%>" />
							<% if (check.get("username") != null) { %>
								<div class="error"><%=check.get("username")%></div>
							<% } %>
						</td>
					</tr>
					<tr>
						<td width="30%" class="password">Password</td>
						<td>
							<input type="password" name="password" value="<%=user.getPassword()%>" style="width: 280px" />
							<% if (check.get("password") != null) { %>
								<div class="error"><%=check.get("password")%></div>
							<% } %>
						</td>
					</tr>
					<tr>
						<td></td>
						<td>
							<button type="submit">Login</button>
						</td>
					</tr>
				</tbody>
			</table>
			</form>
		</div>
<jsp:include page="/demo/layouts/footer.jsp">
    <jsp:param name="language" value="1" />
</jsp:include>